﻿cmake_minimum_required(VERSION 3.3)

list(APPEND CMAKE_MODULE_PATH "C:/Users/Deller/Documents/3rdlibs/share")

project(MeshCutRender)

#1. glew
find_package(GLEW)
if (NOT TARGET GLEW::glew)
	message(FATAL_ERROR "glew not found")
endif()

#2. OpenGL
find_package(OpenGL REQUIRED)
if (OPENGL_FOUND)
	include_directories(${OPENGL_INCLUDE_DIR})
else()
	message(FATAL_ERROR "opengl not found")
endif()

#3. freeglut
find_package(Freeglut)
if (FREEGLUT_FOUND)
	include_directories(${FREEGLUT_INCLUDE_DIRS})
else()
	message(FATAL_ERROR "Freeglut not found")
endif()

#4. Assimp
find_package(Assimp)
if (ASSIMP_FOUND)
	include_directories(${ASSIMP_INCLUDE_DIRS})
else()
	message(FATAL_ERROR "Assimp not found")
endif()

#5.GLM
find_package(GLM)
if (NOT TARGET glm)
	message(FATAL_ERROR "glm not found")
endif()

set(OGLDEV_LINK_LIBS 	
	${ASSIMP_LIBS} 
	${FREEGLUT_LIBS} 
	GLEW::glew 
	${OPENGL_LIBRARIES}
	glm
)

add_executable(MeshCutRender technique.h technique.cpp main.cpp cut.vert cut.frag simple.vert simple.frag)

target_link_libraries(MeshCutRender ${OGLDEV_LINK_LIBS})